@extends('Admin.Layouts.index')

@section('title_name')
	添加商品
@endsection

@section('style3')
	active
@endsection

@section('container')
	<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
	<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
	<div class="container">
		<div class="mws-panel grid_8">
			<div class="mws-panel-header">
				<span>添加商品</span>
			</div>
			<div class="mws-panel-body no-padding">
				@if(count($errors)>0)
					<div class="mws-form-message error">
						<ul>
							@foreach($errors->all() as $error)
								<li>{{$error}}</li>
							@endforeach
						</ul>
					</div>
				@endif
				<form class="mws-form" action="/admin/goods/insert" enctype="multipart/form-data" method="post">
					{{csrf_field()}}
					<div class="mws-form-inline">
						<div class="mws-form-row">
							<label class="mws-form-label">商品名称</label>
							<div class="mws-form-item">
								<input type="text" class="large" name="goods_name">
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">商品价格</label>
							<div class="mws-form-item">
								<input type="text" class="large" name="goods_price">
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">商品图片</label>
							<div class="mws-form-item">
								<input type="file" name="goods_img" value="" id="" class="large" >
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">所属类别</label>
							<div class="mws-form-item">
								<select class="large" name="cate_id">
									<option value="0">请选择</option>
									@foreach($cates as $k=>$v)
										<option value="{{$v['id']}}">{{$v['name']}}</option>
									@endforeach
								</select>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">选择品牌</label>
							<div class="mws-form-item">
								<select class="large" name="brand_id">
									<option value="0">请选择</option>
									<option value="1">耐克</option>
									<option value="2">阿迪达斯</option>
								</select>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">商品库存</label>
							<div class="mws-form-item">
								<input type="text" class="large" name="goods_stock">
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">是否上架</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="radio" value="1" name='is_sale'> <label>是</label></li>
									<li><input type="radio" value="0" name='is_sale'> <label>否</label></li>
								</ul>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">是否精品</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="radio" value="1" name='is_best'> <label>是</label></li>
									<li><input type="radio" value="0" name='is_best'> <label>否</label></li>
								</ul>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">是否热销</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="radio" value="1" name='is_hot'> <label>是</label></li>
									<li><input type="radio" value="0" name='is_hot'> <label>否</label></li>
								</ul>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">是否新品</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="radio" value="1" name='is_new'> <label>是</label></li>
									<li><input type="radio" value="0" name='is_new'> <label>否</label></li>
								</ul>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">商品颜色</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="checkbox" name="goods_color[]" value="红色"> <label>红色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="橙色"> <label>橙色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="黄色"> <label>黄色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="绿色"> <label>绿色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="粉色"> <label>粉色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="蓝色"> <label>蓝色</label></li>
									<li><input type="checkbox" name="goods_color[]" value="紫色"> <label>紫色</label></li>
								</ul>
							</div>
						</div>

						<div class="mws-form-row">
							<label class="mws-form-label">商品尺码</label>
							<div class="mws-form-item clearfix">
								<ul class="mws-form-list inline">
									<li><input type="checkbox" name="goods_size[]" value="35"> <label>35</label></li>
									<li><input type="checkbox" name="goods_size[]" value="36"> <label>36</label></li>
									<li><input type="checkbox" name="goods_size[]" value="37"> <label>37</label></li>
									<li><input type="checkbox" name="goods_size[]" value="38"> <label>38</label></li>
									<li><input type="checkbox" name="goods_size[]" value="39"> <label>39</label></li>
									<li><input type="checkbox" name="goods_size[]" value="40"> <label>40</label></li>
									<li><input type="checkbox" name="goods_size[]" value="41"> <label>41</label></li>
									<li><input type="checkbox" name="goods_size[]" value="42"> <label>42</label></li>
									<li><input type="checkbox" name="goods_size[]" value="43"> <label>43</label></li>
								</ul>
							</div>
						</div>
						<div class="mws-form-row">
							<label class="mws-form-label">商品描述</label>
							<div class="mws-form-item">
								<script id="editor" type="text/plain" style="width:1322px;height:300px;" name="goods_desc"></script>
                                </div>
                                </div>
                                </div>
                                <div class="mws-button-row">
                                    <input type="submit" value="添加" class="btn btn-danger">
                                    <input type="reset" value="重置" class="btn ">
                                    </div>
                                    </form>
                                    </div>
                                    </div>
                                    </div>
                                    <script>
                                var ue = UE.getEditor('editor');
								</script>
@endsection
